#pragma once

#include <string>

class ProjectSaveState
{
	bool mSaved;
	std::string mPath;
	bool mPathDef;
public:
	ProjectSaveState( ) : mSaved(false), mPathDef(false){}
	ProjectSaveState( bool saved, bool path_defed, const std::string &path ) : mSaved(saved), mPathDef(path_defed), mPath(path){}
	~ProjectSaveState(){}

	bool isPathDefined() const{ return mPathDef; }
	bool isSaved() const{ return mSaved; }
	bool isModified() const{ return !mSaved; }
	
	void setSaved( bool state, const std::string &path = "" ){
		mSaved = state;
		if( state )
			setPath( path );
	}
	void setModified( bool state, const std::string &path = "" ){
		mSaved = !state;
		if( mSaved )
			setPath( path );
	}
	void setPath( const std::string &path ){
		mPath = path;
		if( !mPath.empty() ) mPathDef = true;
	}

	const std::string& savePath() const{ return mPath; }
};